import {defineStore} from 'pinia'

export const useAclStore = defineStore('acl', {
    state: () => ({

        initRouter: false,
        // 用户拥有的全局菜单
        fullMenu: [],
        // 用户拥有的全部权限表达式
        fullExpr: [],
        // 用具拥有的全部角色
        fullRole: [],


    }),
    getters: {
        getInitRouter: (state) => state.initRouter,
        getFullMenu: (state) => state.fullMenu,
        getFullExpr: (state) => state.fullExpr,
        getFullRole: (state) => state.fullRole,


    },
    actions: {
        // 设置权限
        setInitRouter(b: boolean) {this.initRouter = b},
        setFullMenu(data:[]) {this.fullMenu = data},
        setFullExpr(data:[]) {this.fullExpr = data},
        setFullRole(data:[]) {this.fullRole = data},
        removeAll() {
            this.initRouter = false
            // 用户拥有的全局菜单
            this.fullMenu = []
            // 用户拥有的全部权限表达式
            this.fullExpr = []
            // 用具拥有的全部角色
            this.fullRole = []


        },
    },
})


